// 变量定义
@card-border: rgba(64, 169, 255, 0.3);
@text-color: #fff;
@accent-color: #40a9ff;
@border-color: #3382c3;

.custom-dropdown {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 200px;
}

.dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 12px;
  border: 1px solid @border-color;
  border-radius: 2px;
  background-color: rgba(64, 169, 255, 0.1) !important;
  cursor: pointer;
  transition: all 0.3s ease;
  color: rgba(255, 255, 255, 1);
  font-size: 12px;

  .dropdown-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
  }

  .dropdown-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    font-size: 10px;
    transition: transform 0.3s ease;
    width: 10px;
    height: 10px;
    background: url("@/assets/images/png/arrow-up.png") no-repeat;
    background-size: 100% 100%;
    transition: transform 0.3s ease;
    transform: rotate(180deg);

    &.rotate {
      transform: rotate(0deg);
    }
  }
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background-color: rgba(6, 47, 93, 1) !important;
  border: 1px solid @border-color;
  border-radius: 2px;
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;

  // 滚动条样式
  &::-webkit-scrollbar {
    width: 4px;
  }

  &::-webkit-scrollbar-track {
    background: transparent;
  }

  &::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
  }

  &::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.3);
  }
}

.dropdown-option {
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  &:hover {
    color: rgba(255, 255, 255, 1);
    background-color: rgba(64, 169, 255, 0.1) !important;
    padding-left: 16px;
  }

  &.selected {
    color: rgba(255, 255, 255, 1);
    font-weight: 500;
    padding-left: 16px;
  }
}
